package db

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"log"
)

var db *gorm.DB

func GetDb()  *gorm.DB{


	db, err := gorm.Open("mysql", "root:123456@/orm?charset=utf8&parseTime=True&loc=Local")
	db.LogMode(true)

	log.Println("111111")

	if err != nil {
		log.Panicln("err:", err.Error())
	}
	return db
}
